package com.kate.mall.product.queue;


import com.kate.mall.product.entity.GoodsSpecificationEntity;
import com.kate.mall.product.service.GoodsSpecificationService;

/**
 * @author 新梦想.陈超
 * @version 2021.2
 * @Description: {TODO}
 * @date 2022/7/14 下午7:36
 */

public class GoodsSpecificationUpdateDBRequest implements Request{
    private GoodsSpecificationEntity goodsSpecificationEntity;
    private GoodsSpecificationService goodsSpecificationService;

    public GoodsSpecificationUpdateDBRequest(GoodsSpecificationEntity goodsSpecificationEntity, GoodsSpecificationService goodsSpecificationService) {
        this.goodsSpecificationEntity = goodsSpecificationEntity;
        this.goodsSpecificationService = goodsSpecificationService;
    }

    @Override
    public void process() {
        //1.删除缓存 然后更新数据
        goodsSpecificationService.updateRelatedCache(goodsSpecificationEntity);
    }

    @Override
    public Integer getGoodsSpecificationId() {
        return goodsSpecificationEntity.getId();
    }
}
